package com.nanhai.buddhist.college.module.collegebase.api.student;

import com.nanhai.buddhist.college.framework.common.pojo.CommonResult;
import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.module.collegebase.api.student.dto.StudentRespDTO;
import com.nanhai.buddhist.college.module.collegebase.api.student.dto.StudentUserRespDTO;
import com.nanhai.buddhist.college.module.collegebase.api.student.vo.UpdatePasswordVO;
import com.nanhai.buddhist.college.module.collegebase.api.teacher.vo.ClassesStudentListPageVO;
import com.nanhai.buddhist.college.module.collegebase.enums.ApiConstants;
import io.swagger.annotations.Api;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import java.util.Collection;
import java.util.List;

/**
 * @author AKai
 * @date 2022/8/22
 */
@Api(tags = "RPC 服务 - 学生学籍信息提供")
@FeignClient(name = ApiConstants.NAME)
public interface StudentApi {

    String PREFIX = ApiConstants.PREFIX + "/student-roll";

    @GetMapping(PREFIX + "/info")
    CommonResult<StudentRespDTO> getStudentRespDTOById(@RequestParam("studentId") String studentId);

    @GetMapping(PREFIX + "/List")
    CommonResult<List<StudentRespDTO>> getStudentRespDTOByIds(@RequestParam("ids") Collection<String> ids);

    @PostMapping(PREFIX + "/byClassesId/page")
    CommonResult<PageResult<StudentRespDTO>> getStudentRespDTO(@RequestBody ClassesStudentListPageVO req);

    @PostMapping(PREFIX + "/byClassesId/List")
    CommonResult<List<StudentRespDTO>> getStudentListByClassesId(@RequestParam("classesId")  String classesId);

    @GetMapping(PREFIX + "/getStudentByUserName")
    CommonResult<StudentUserRespDTO> getStudentByUserName(@RequestParam("username") String studentUsername);

    @PostMapping((PREFIX + "/updatedPassWord"))
    CommonResult<Boolean> updatedStudentPassword(@RequestBody UpdatePasswordVO req);

}


